﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>宠物寄养</title>
	<link rel='stylesheet' href='/stylesheets/xiuxiu.css' media='screen' />
	<link href="/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
	<link href="/stylesheets/homepage.css" rel="stylesheet" type="text/css" media="all" />
	<!--<link href="/css/animate.css" rel="stylesheet" type="text/css" media="all">-->
	<!--<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>-->
	<script src="/js/jquery-1.8.3.js"></script>
</head>
<body>
<div class="header ">
	<div class="container">
		<div class="header-left grid">
			<div class="grid__item color-1">
				<h1><a href="/"><i></i><span class="link link--kukuri" data-letters="爱宠驿站">爱宠驿站</span></a></h1>
			</div>
		</div>
		<div class="header-right">
			<%
			if(username==undefined){
			%>
			<a href="/login">
				<img src="/images/person.png" alt="">
				登录
			</a>

			<%
			}else{
			%>

			<a href="/users">
				<img src="/images/person.png" alt="">
				<%=username%>
			</a>
			<%
			}
			%>

		</div>
		<div class="clearfix"></div>
	</div>
</div>
<div class="banner page-head">
	<div class="ban-top ">
		<div class="container">
			<div class="ban-top-con">
				<div class="top_nav_left">
					<nav class="navbar navbar-default">
						<div class="container-fluid">
							<!-- Brand and toggle get grouped for better mobile display -->
							<div class="navbar-header">
								<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
									<span class="sr-only">Toggle navigation</span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
								</button>
							</div>
							<!-- Collect the nav links, forms, and other content for toggling -->
							<div class="collapse navbar-collapse menu--shylock" id="bs-example-navbar-collapse-1">
								<ul class="nav navbar-nav menu__list">
									<li class="active menu__item "><a class="menu__link" href="/">首页 <span class="sr-only">(current)</span></a></li>
									<li class=" menu__item "><a class="menu__link" href="/about">关于我们</a></li>
									<li class=" menu__item"><a class="menu__link" href="/users/apply_foster">申请寄养家庭</a></li>
									<li class=" menu__item  menu__item--current"><a class="menu__link" href="/users/foster">宠物寄养</a></li>
									<li class=" menu__item"><a class="menu__link" href="/article">社区</a></li>

								</ul>
							</div>
						</div>
					</nav>
				</div>
				<div class="top_nav_right">
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
</div>
	<div id="wrapper">
		<div id="container">

			<%
			for(var i=0;i<=shops.length-1;i++){
			%>
			<div class="pet-grid">
				<div class="operation">
					￥10元起
				</div>
				<div class="imgholder"><a href="/users/detail/<%=shops[i].userno%>"><img class="lazy" src="/images/pixel.gif" data-original="/images/<%=shops[i].image%>" width="175" /></a></div>
				<div class="users_icon">
					<img src="/images/<%=shops[i].pic%>" alt="" class="big_icon">
				</div>
				<strong><%=shops[i].shop_name%></strong>
				<p><%=shops[i].useraddress%></p>
				<div class="meta"><a href="/users/detail/<%=shops[i].userno%>" target="_blank">点击查看>>></a></div>
			</div>
			<%
			}
			%>
		</div>
	</div>

<!--返回首页-->
	<%include back-top.html%>
	<%include footer.html%>
<!--</div>-->

<script type="text/javascript" src="/js/jquery.lazyload.min.js"></script>
<script type="text/javascript" src="/js/blocksit.min.js"></script>
<script src="/javascripts/homepage.js"></script>
<script type="text/javascript">
$(function(){
	$(function () {
		$('.imgholder').hover(function () {
			$('.imgholder img')
		})
	});
	$("img.lazy").lazyload({		
		load:function(){
			$('#container').BlocksIt({
				numOfCol:4,
				offsetX: 8,
				offsetY: 8
			});
		}
	});	
//	$(window).scroll(function(){
//			// 当滚动到最底部以上50像素时,加载新内容
//		if (50 > $(document).height() - $(this).scrollTop() - $(this).height()){
//			$('#container').append($("#test").html());
//			$('#container').BlocksIt({
//				numOfCol:4,
//				offsetX: 8,
//				offsetY: 8
//			});
//			$("img.lazy").lazyload();
//		}
//	});
	
	//window resize
	var currentWidth = 1100;
	$(window).resize(function() {
		var winWidth = $(window).width();
		var conWidth;
		if(500>winWidth) {
			conWidth = 275;
			col = 1;
		} else if( 880>winWidth ) {
			conWidth = 560;
			col = 2;
		} else if( 1100 > winWidth) {
			conWidth = 780;
			col = 3;
		} else {
			conWidth = 1200;
			col = 4;
		}

		if(conWidth != currentWidth) {
			currentWidth = conWidth;
			$('#container').width(conWidth);
			$('#container').BlocksIt({
				numOfCol: col,
				offsetX: 8,
				offsetY: 8
			});
		}
	});
});
</script>

</body>
</html>